var d2_1={
		name:"一般公共预算收入",
		area:"全省及十三市",
		suffix:"亿元",
		data:[
		    {area: "全省合计", total: 2708, totalrank: "-", growth: 10.1, growthrank: "-"},
		    {area: "南京市", total: 337.8, totalrank: 2, growth: 12.2, growthrank: 6},
		    {area: "无锡市", total: 274.9, totalrank: 3, growth: 7.5, growthrank: 10},
		    {area: "徐州市", total: 168.8, totalrank: 5, growth: 10.6, growthrank: 9},
		    {area: "常州市", total: 145.6, totalrank: 7, growth: 6, growthrank: 12},
		    {area: "苏州市", total: 545.4, totalrank: 1, growth: 7.2, growthrank: 11},
		    {area: "南通市", total: 189, totalrank: 4, growth: 15.7, growthrank: 1},
		    {area: "连云港市", total: 100.9, totalrank: 11, growth: 13.1, growthrank: 5},
		    {area: "淮安市", total: 120, totalrank: 8, growth: 11.9, growthrank: 7},
		    {area: "盐城市", total: 161.1, totalrank: 6, growth: 15.1, growthrank: 2},
		    {area: "扬州市", total: 107.1, totalrank: 9, growth: 14.1, growthrank: 4},
		    {area: "镇江市", total: 94.1, totalrank: 12, growth: 4.6, growthrank: 13},
		    {area: "泰州市", total: 104.1, totalrank: 10, growth: 14.3, growthrank: 3},
		    {area: "宿迁市", total: 83.7, totalrank: 13, growth: 11.2, growthrank: 8}
		]
	};

var d2_2={
	name:"规模以上工业增加值",
	area:"全省及十三市",
	suffix:"亿元",
	data:[
	    {area: "全省合计", total: 10361, totalrank: "-", growth: 8.2, growthrank: "-"},
	    {area: "南京市", total: 974.3, totalrank: 2, growth: 8.6, growthrank: 10},
	    {area: "无锡市", total: 890.8, totalrank: 3, growth: 3.6, growthrank: 13},
	    {area: "徐州市", total: 786.4, totalrank: 6, growth: 9.3, growthrank: 8},
	    {area: "常州市", total: 784.7, totalrank: 7, growth: 8.6, growthrank: 10},
	    {area: "苏州市", total: 1929, totalrank: 1, growth: 4, growthrank: 12},
	    {area: "南通市", total: 858.2, totalrank: 4, growth: 10.7, growthrank: 5},
	    {area: "连云港市", total: 341.7, totalrank: 12, growth: 14.1, growthrank: 1},
	    {area: "淮安市", total: 461.1, totalrank: 11, growth: 11.6, growthrank: 2},
	    {area: "盐城市", total: 662.3, totalrank: 10, growth: 11.1, growthrank: 3},
	    {area: "扬州市", total: 702.8, totalrank: 8, growth: 9.1, growthrank: 9},
	    {area: "镇江市", total: 677.9, totalrank: 9, growth: 10, growthrank: 7},
	    {area: "泰州市", total: 808, totalrank: 5, growth: 10.7, growthrank: 5},
	    {area: "宿迁市", total: 269, totalrank: 13, growth: 10.9, growthrank: 4}
	]
}

var d2_3={
	name:"工业应税销售收入",
	area:"全省及十三市",
	suffix:"亿元",
	data:[
	    {area: "全省合计", total: 31275.4, totalrank: "-", growth: 0.3, growthrank: "-"},
	    {area: "南京市", total: 3505, totalrank: 3, growth: -3, growthrank: 12},
	    {area: "无锡市", total: 5205.3, totalrank: 2, growth: -0.6, growthrank: 8},
	    {area: "徐州市", total: 960.7, totalrank: 10, growth: -12.1, growthrank: 13},
	    {area: "常州市", total: 2670.6, totalrank: 4, growth: -2.5, growthrank: 11},
	    {area: "苏州市", total: 10072.8, totalrank: 1, growth: 0.5, growthrank: 7},
	    {area: "南通市", total: 1948, totalrank: 5, growth: 2.4, growthrank: 6},
	    {area: "连云港市", total: 628.9, totalrank: 12, growth: 13.9, growthrank: 1},
	    {area: "淮安市", total: 805.9, totalrank: 11, growth: 2.7, growthrank: 5},
	    {area: "盐城市", total: 1375.1, totalrank: 6, growth: 11.3, growthrank: 2},
	    {area: "扬州市", total: 1280.5, totalrank: 7, growth: -2, growthrank: 10},
	    {area: "镇江市", total: 1091.2, totalrank: 9, growth: -1.3, growthrank: 9},
	    {area: "泰州市", total: 1272.8, totalrank: 8, growth: 9.3, growthrank: 3},
	    {area: "宿迁市", total: 458.7, totalrank: 13, growth: 4.2, growthrank: 4}
	]
}

var d2_4={
	name:"工业用电量",
	area:"全省及十三市",
	suffix:"亿千瓦时",
	data:[
	    {area: "全省合计", total: 1208.9, totalrank: "-", growth: 2.2, growthrank: "-"},
	    {area: "南京市", total: 93.9, totalrank: 4, growth: 4.3, growthrank: 5},
	    {area: "无锡市", total: 148.5, totalrank: 2, growth: 0.7, growthrank: 9},
	    {area: "徐州市", total: 79.6, totalrank: 5, growth: 3.3, growthrank: 6},
	    {area: "常州市", total: 101.6, totalrank: 3, growth: 5.1, growthrank: 3},
	    {area: "苏州市", total: 324.2, totalrank: 1, growth: 3.2, growthrank: 7},
	    {area: "南通市", total: 76.8, totalrank: 6, growth: 5.3, growthrank: 2},
	    {area: "连云港市", total: 35.3, totalrank: 11, growth: 10.9, growthrank: 1},
	    {area: "淮安市", total: 32.7, totalrank: 12, growth: -1.3, growthrank: 11},
	    {area: "盐城市", total: 62.6, totalrank: 7, growth: -6.7, growthrank: 13},
	    {area: "扬州市", total: 47.1, totalrank: 10, growth: 4.8, growthrank: 4},
	    {area: "镇江市", total: 49.1, totalrank: 9, growth: -1.2, growthrank: 10},
	    {area: "泰州市", total: 53.1, totalrank: 8, growth: -3, growthrank: 12},
	    {area: "宿迁市", total: 31.4, totalrank: 13, growth: 1.7, growthrank: 8}
	]
}

var d2_5={
	name:"固定资产投资",
	area:"全省及十三市",
	suffix:"亿元",
	data:[
	    {area: "全省合计", total: 13493.9, totalrank: "-", growth: 11.2, growthrank: "-"},
	    {area: "南京市", total: 1619.3, totalrank: 2, growth: 3.3, growthrank: 11},
	    {area: "无锡市", total: 1311, totalrank: 4, growth: 3, growthrank: 12},
	    {area: "徐州市", total: 863.5, totalrank: 9, growth: 16.2, growthrank: 8},
	    {area: "常州市", total: 1057.4, totalrank: 6, growth: 7, growthrank: 10},
	    {area: "苏州市", total: 1672, totalrank: 1, growth: -9.1, growthrank: 13},
	    {area: "南通市", total: 1431, totalrank: 3, growth: 14.3, growthrank: 9},
	    {area: "连云港市", total: 640.7, totalrank: 12, growth: 25.1, growthrank: 3},
	    {area: "淮安市", total: 641.1, totalrank: 11, growth: 25.4, growthrank: 1},
	    {area: "盐城市", total: 1129.3, totalrank: 5, growth: 25.3, growthrank: 2},
	    {area: "扬州市", total: 1001.3, totalrank: 7, growth: 17.9, growthrank: 7},
	    {area: "镇江市", total: 889.9, totalrank: 8, growth: 19.6, growthrank: 5},
	    {area: "泰州市", total: 757.9, totalrank: 10, growth: 24.5, growthrank: 4},
	    {area: "宿迁市", total: 485.4, totalrank: 13, growth: 18.5, growthrank: 6}
	]
}


var d2_6={
	name:"社会消费品零售总额",
	area:"全省及十三市",
	suffix:"亿元",
	data:[
	    {area: "全省合计", total: 8348.4, totalrank: "-", growth: 9.7, growthrank: "-"},
	    {area: "南京市", total: 1477.4, totalrank: 1, growth: 9.2, growthrank: 10},
	    {area: "无锡市", total: 921.4, totalrank: 3, growth: 8.9, growthrank: 11},
	    {area: "徐州市", total: 764.4, totalrank: 5, growth: 12.2, growthrank: 1},
	    {area: "常州市", total: 641.3, totalrank: 6, growth: 9.4, growthrank: 8},
	    {area: "苏州市", total: 1436.8, totalrank: 2, growth: 8.1, growthrank: 13},
	    {area: "南通市", total: 769.8, totalrank: 4, growth: 9.5, growthrank: 7},
	    {area: "连云港市", total: 265.9, totalrank: 12, growth: 10.8, growthrank: 4},
	    {area: "淮安市", total: 314.4, totalrank: 11, growth: 12, growthrank: 2},
	    {area: "盐城市", total: 475, totalrank: 7, growth: 11.5, growthrank: 3},
	    {area: "扬州市", total: 400.7, totalrank: 8, growth: 9.4, growthrank: 8},
	    {area: "镇江市", total: 359.3, totalrank: 9, growth: 10.3, growthrank: 5},
	    {area: "泰州市", total: 322.7, totalrank: 10, growth: 10, growthrank: 6},
	    {area: "宿迁市", total: 199.3, totalrank: 13, growth: 8.7, growthrank: 12}
	]
}


var d2_7={
	name:"进出口总值",
	area:"全省及十三市",
	suffix:"亿美元",
	data:[
	    {area: "全省合计", total: 1686.8, totalrank: "-", growth: -4.2, growthrank: "-"},
	    {area: "南京市", total: 169.7, totalrank: 3, growth: -2.2, growthrank: 6},
	    {area: "无锡市", total: 228, totalrank: 2, growth: -3.3, growthrank: 7},
	    {area: "徐州市", total: 15.7, totalrank: 11, growth: -27, growthrank: 13},
	    {area: "常州市", total: 91.4, totalrank: 5, growth: -3.3, growthrank: 7},
	    {area: "苏州市", total: 905.4, totalrank: 1, growth: -6.2, growthrank: 10},
	    {area: "南通市", total: 104.2, totalrank: 4, growth: 4.2, growthrank: 4},
	    {area: "连云港市", total: 25, totalrank: 10, growth: -4.7, growthrank: 9},
	    {area: "淮安市", total: 13.6, totalrank: 12, growth: 14.2, growthrank: 2},
	    {area: "盐城市", total: 28, totalrank: 9, growth: 22.9, growthrank: 1},
	    {area: "扬州市", total: 32.9, totalrank: 7, growth: 7.5, growthrank: 3},
	    {area: "镇江市", total: 31, totalrank: 8, growth: 0, growthrank: 5},
	    {area: "泰州市", total: 33.5, totalrank: 6, growth: -7.7, growthrank: 11},
	    {area: "宿迁市", total: 8.4, totalrank: 13, growth: -26.1, growthrank: 12}
	]
}

var d2_8={
	name:"出口总值",
	area:"全省及十三市",
	suffix:"亿美元",
	data:[
	    {area: "全省合计", total: 1027.3, totalrank: "-", growth: 0.1, growthrank: "-"},
	    {area: "南京市", total: 94.7, totalrank: 3, growth: 1.5, growthrank: 8},
	    {area: "无锡市", total: 137.7, totalrank: 2, growth: 0.8, growthrank: 9},
	    {area: "徐州市", total: 11.9, totalrank: 11, growth: -27, growthrank: 12},
	    {area: "常州市", total: 68.4, totalrank: 5, growth: 2.2, growthrank: 6},
	    {area: "苏州市", total: 529.6, totalrank: 1, growth: -2.1, growthrank: 10},
	    {area: "南通市", total: 74.1, totalrank: 4, growth: 11.7, growthrank: 3},
	    {area: "连云港市", total: 12.9, totalrank: 10, growth: -6.5, growthrank: 11},
	    {area: "淮安市", total: 9.5, totalrank: 12, growth: 18.5, growthrank: 2},
	    {area: "盐城市", total: 18.4, totalrank: 9, growth: 53.2, growthrank: 1},
	    {area: "扬州市", total: 24.5, totalrank: 6, growth: 2.4, growthrank: 5},
	    {area: "镇江市", total: 20.3, totalrank: 7, growth: 7.8, growthrank: 4},
	    {area: "泰州市", total: 20.1, totalrank: 8, growth: 1.9, growthrank: 7},
	    {area: "宿迁市", total: 5.3, totalrank: 13, growth: -45.5, growthrank: 13}
	]
}

var d2_9={
	name:"金融系统本外币贷款余额",
	area:"全省及十三市",
	suffix:"亿元",
	data:[
	    {area: "全省合计", total: 75936.8, totalrank: "-", growth: 3436.3, growthrank: "-"},
	    {area: "南京市", total: 17330.6, totalrank: 2, growth: 879, growthrank: 2},
	    {area: "无锡市", total: 9176, totalrank: 3, growth: 146.3, growthrank: 7},
	    {area: "徐州市", total: 2869.4, totalrank: 9, growth: 130.1, growthrank: 9},
	    {area: "常州市", total: 5076.7, totalrank: 5, growth: 179.4, growthrank: 6},
	    {area: "苏州市", total: 19318.7, totalrank: 1, growth: 883.9, growthrank: 1},
	    {area: "南通市", total: 5562.7, totalrank: 4, growth: 303.7, growthrank: 3},
	    {area: "连云港市", total: 1665.2, totalrank: 12, growth: 57.8, growthrank: 13},
	    {area: "淮安市", total: 1730.5, totalrank: 11, growth: 94.9, growthrank: 11},
	    {area: "盐城市", total: 2795.8, totalrank: 10, growth: 192, growthrank: 5},
	    {area: "扬州市", total: 2882.3, totalrank: 7, growth: 116.2, growthrank: 10},
	    {area: "镇江市", total: 2870.8, totalrank: 8, growth: 140.6, growthrank: 8},
	    {area: "泰州市", total: 3080, totalrank: 6, growth: 225.4, growthrank: 4},
	    {area: "宿迁市", total: 1578.1, totalrank: 13, growth: 87.1, growthrank: 12}
	]
}


var keymap2={
	"全省":0,
	"南京市":1,
	"无锡":2,
	"徐州":3,
	"常州":4,
	"苏州":5,
	"南通":6,
	"连云港":7,
	"淮安":8,
	"盐城":9,
	"扬州":10,
	"镇江":11,
	"泰州":12,
	"宿迁市":13
};


var datajson2=[];
datajson2.push(d2_1);
datajson2.push(d2_2);
datajson2.push(d2_3);
datajson2.push(d2_4);
datajson2.push(d2_5);
datajson2.push(d2_6);
datajson2.push(d2_7);
datajson2.push(d2_8);
datajson2.push(d2_9);





/**
 * [getMaxAndMin 获取最大值和最小值]
 * @param  {[type]} data [数据数组]
 * @return {[type]}      [返回最大和最小的近似值]
 */
function getMaxAndMin(data){
    var max,min;
    for(m in data){
      	var d = data[m].value;
        if(isNaN(parseInt(d))==true) continue;
        min = min == undefined ? d : min;
        max = max == undefined ? d : max;
        min = min > d ? d : min;
        max = max < d ? d : max;
    }
    min = getTen(min,false);
    max = getTen(max,true);
    count=max-min;
    //count>100?count/20:count/10
    return [max, min, 5]
}

function getTen(m,b){
  var num=m
  if(b==true){
    num=num<10?10:num;
    if(num==10) return num;
    num=Math.floor(num);
    //取最大整数
    var nums=num+'',numsl=nums.length;
    nums=nums.substr(0,1);
    num=(parseInt(nums)+2)*Math.pow(10, numsl - 1);
  }else{
    var zero=num<0?true:false;
    num=Math.floor(num);
    var nums=Math.abs(num)+'',numsl=nums.length;
    if(numsl<2){
      if(zero==true){
        return -10;
      }else{
        return 0;
      }
    }
    //取最小整数
    nums=nums.substr(0,1);
    num=(parseInt(nums)+(zero==true?1:-1))*Math.pow(10, numsl - 1)*(zero==true?-1:1);
  }
  return num;
}